'\" t
.\"     Title: IPSEC_EROUTE
.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\"      Date: 03 April 2007
.\"    Manual: [FIXME: manual]
.\"    Source: [FIXME: source]
.\"  Language: English
.\"
.TH "IPSEC_EROUTE" "8" "03 April 2007" "[FIXME: source]" "[FIXME: manual]"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ipsec_eroute \- manipulate IPSEC extended routing tables
.SH "SYNOPSIS"
.HP \w'\fBipsec\ eroute\fR\ 'u
\fBipsec eroute\fR \fB\fI\-\-add\fR\fR\ \fB\-\-eraf\fR\ \fI(inet\ |\ inet6)\fR\ \fB\-\-src\fR\ \fIsrc/srcmaskbits|srcmask\fR\ \fB\-\-dst\fR\ \fIdst/dstmaskbits|dstmask\fR\ [[\fB\-\-transport\-proto\fR\ \fItransport\-protocol\fR]]\ [\fB\-\-src\-port\ \fR\fB\fIsource\-port\fR\fR]\ [\fB\-\-dst\-port\ \fR\fB\fIdest\-port\fR\fR]\ [<SAID>] 
.HP \w'\fBipsec\ eroute\fR\ 'u
\fBipsec eroute\fR \fB\fI\-\-replace\fR\fR\ \fB\-\-eraf\fR\ \fI(inet\ |\ inet6)\fR\ \fB\-\-src\fR\ \fIsrc/srcmaskbits|srcmask\fR\ \fB\-\-dst\fR\ \fIdst/dstmaskbits|dstmask\fR\ [[\fB\-\-transport\-proto\fR\ \fItransport\-protocol\fR]]\ [\fB\-\-src\-port\ \fR\fB\fIsource\-port\fR\fR]\ [\fB\-\-dst\-port\ \fR\fB\fIdest\-port\fR\fR]\ [<SAID>] 
.HP \w'\fBipsec\ eroute\fR\ 'u
\fBipsec eroute\fR \fB\fI\-\-del\fR\fR\-\-del\fB\-\-eraf\fR\ \fI(inet\ |\ inet6)\fR\ \fB\-\-src\fR\fIsrc/srcmaskbits|srcmask\fR\fB\-\-dst\fR\fIdst/dstmaskbits|dstmask\fR\ [[\fB\-\-transport\-proto\fR\ \fItransport\-protocol\fR]]\ [\fB\-\-src\-port\ \fR\fB\fIsource\-port\fR\fR]\ [\fB\-\-dst\-port\ \fR\fB\fIdest\-port\fR\fR]\ [<SAID>] 
.HP \w'\fBipsec\ eroute\fR\ 'u
\fBipsec eroute\fR \-\-clear
.HP \w'\fBipsec\ eroute\fR\ 'u
\fBipsec eroute\fR \-\-help
.HP \w'\fBipsec\ eroute\fR\ 'u
\fBipsec eroute\fR \-\-version
.SH "SAID DESCRIPTION"
.PP
Where <SAID> is \-\-af (inet | inet6) \-\-edst edst \-\-spi spi \-\-proto proto OR \-\-said said OR \-\-said (%passthrough | %passthrough4 | %passthrough6 | %drop | %reject | %trap | %hold | %pass )
.SH "DESCRIPTION"
.PP
\fIEroute\fR
manages the IPSEC extended routing tables, which control what (if any) processing is applied to non\-encrypted packets arriving for IPSEC processing and forwarding\&. The form with no additional arguments lists the contents of /proc/net/ipsec_eroute\&. The
\fB\-\-add\fR
form adds a table entry, the
\fB\-\-replace\fR
form replaces a table entry, while the
\fB\-\-del\fR
form deletes one\&. The
\fB\-\-clear\fR
form deletes the entire table\&.
.PP
A table entry consists of:
.PP
+
.RS 4
source and destination addresses, with masks, source and destination ports and protocol for selection of packets\&. The source and destination ports are only legal if the transport protocol is
\fBTCP\fR
or
\fBUDP\&.\fR
A port can be specified as either decimal, hexadecimal (leading 0x), octal (leading 0) or a name listed in the first column of /etc/services\&. A transport protocol can be specified as either decimal, hexadecimal (leading 0x), octal (leading 0) or a name listed in the first column of /etc/protocols\&. If a transport protocol or port is not specified then it defaults to 0 which means all protocols or all ports respectively\&.
.RE
.PP
+
.RS 4
Security Association IDentifier, comprised of:
.RE
.PP
+
.RS 4
protocol (\fIproto\fR), indicating (together with the effective destination and the security parameters index) which Security Association should be used to process the packet
.RE
.PP
+
.RS 4
address family (\fIaf\fR),
.RE
.PP
+
.RS 4
Security Parameters Index (\fIspi\fR), indicating (together with the effective destination and protocol) which Security Association should be used to process the packet (must be larger than or equal to 0x100)
.RE
.PP
+
.RS 4
effective destination (\fIedst\fR), where the packet should be forwarded after processing (normally the other security gateway)
.RE
.PP
+
.RS 4
OR
.RE
.PP
+
.RS 4
SAID (\fIsaid\fR), indicating which Security Association should be used to process the packet
.RE
.PP
Addresses are written as IPv4 dotted quads or IPv6 coloned hex, protocol is one of "ah", "esp", "comp" or "tun" and SPIs are prefixed hexadecimal numbers where \'\&.\' represents IPv4 and \':\' stands for IPv6\&.
.PP
SAIDs are written as "protoafSPI@address"\&. There are also 5 "magic" SAIDs which have special meaning:
.PP
+
.RS 4
\fB%drop\fR
means that matches are to be dropped
.RE
.PP
+
.RS 4
\fB%reject\fR
means that matches are to be dropped and an ICMP returned, if possible to inform
.RE
.PP
+
.RS 4
\fB%trap\fR
means that matches are to trigger an ACQUIRE message to the Key Management daemon(s) and a hold eroute will be put in place to prevent subsequent packets also triggering ACQUIRE messages\&.
.RE
.PP
+
.RS 4
\fB%hold\fR
means that matches are to stored until the eroute is replaced or until that eroute gets reaped
.RE
.PP
+
.RS 4
\fB%pass\fR
means that matches are to allowed to pass without IPSEC processing
.RE
.PP
The format of /proc/net/ipsec_eroute is listed in ipsec_eroute(5)\&.
.SH "EXAMPLES"
.PP
\fBipsec eroute \-\-add \-\-eraf inet \-\-src 192\&.168\&.0\&.1/32 \e\fR

\fB \-\-dst 192\&.168\&.2\&.0/24 \-\-af inet \-\-edst 192\&.168\&.0\&.2 \e\fR

\fB \-\-spi 0x135 \-\-proto tun\fR
.PP
sets up an
\fBeroute\fR
on a Security Gateway to protect traffic between the host
192\&.168\&.0\&.1
and the subnet
192\&.168\&.2\&.0
with
24
bits of subnet mask via Security Gateway
192\&.168\&.0\&.2
using the Security Association with address
192\&.168\&.0\&.2, Security Parameters Index
\fB0x135\fR
and protocol
\fBtun\fR
(50, IPPROTO_ESP)\&.
.PP
\fBipsec eroute \-\-add \-\-eraf inet6 \-\-src 3049:1::1/128 \e\fR

\fB \-\-dst 3049:2::/64 \-\-af inet6 \-\-edst 3049:1::2 \e\fR

\fB \-\-spi 0x145 \-\-proto tun\fR
.PP
sets up an
\fBeroute\fR
on a Security Gateway to protect traffic between the host
\fB3049:1::1\fR
and the subnet
\fB3049:2::\fR
with
64
bits of subnet mask via Security Gateway
\fB3049:1::2\fR
using the Security Association with address
\fB3049:1::2\fR, Security Parameters Index
\fB0x145\fR
and protocol
\fBtun\fR
(50, IPPROTO_ESP)\&.
.PP
\fBipsec eroute \-\-replace \-\-eraf inet \-\-src company\&.com/24 \e\fR

\fB \-\-dst ftp\&.ngo\&.org/32 \-\-said tun\&.135@gw\&.ngo\&.org\fR
.PP
replaces an
\fBeroute\fR
on a Security Gateway to protect traffic between the subnet
\fBcompany\&.com\fR
with
24
bits of subnet mask and the host
\fBftp\&.ngo\&.org\fR
via Security Gateway
\fBgw\&.ngo\&.org\fR
using the Security Association with Security Association ID
\fBtun0x135@gw\&.ngo\&.org\fR
.PP
\fBipsec eroute \-\-del \-\-eraf inet \-\-src company\&.com/24 \e\fR

\fB \-\-dst www\&.ietf\&.org/32 \-\-said %passthrough4\fR
.PP
deletes an
\fBeroute\fR
on a Security Gateway that allowed traffic between the subnet
\fBcompany\&.com\fR
with
24
bits of subnet mask and the host
\fBwww\&.ietf\&.org\fR
to pass in the clear, unprocessed\&.
.PP
\fBipsec eroute \-\-add \-\-eraf inet \-\-src company\&.com/24 \e\fR

\fB \-\-dst mail\&.ngo\&.org/32 \-\-transport\-proto 6 \e\fR

\fB \-\-dst\-port 110 \-\-said tun\&.135@mail\&.ngo\&.org\fR
.PP
sets up an
\fBeroute\fR
on on a Security Gateway to protect only TCP traffic on port 110 (pop3) between the subnet
\fBcompany\&.com\fR
with
24
bits of subnet mask and the host
\fBftp\&.ngo\&.org\fR
via Security Gateway
\fBmail\&.ngo\&.org\fR
using the Security Association with Security Association ID
\fBtun0x135@mail\&.ngo\&.org\&.\fR
Note that any other traffic bound for
\fBmail\&.ngo\&.org\fR
that is routed via the ipsec device will be dropped\&. If you wish to allow other traffic to pass through then you must add a %pass rule\&. For example the following rule when combined with the above will ensure that POP3 messages read from
\fBmail\&.ngo\&.org\fR
will be encrypted but all other traffic to/from
\fBmail\&.ngo\&.org\fR
will be in clear text\&.
.PP
\fBipsec eroute \-\-add \-\-eraf inet \-\-src company\&.com/24 \e\fR

\fB \-\-dst mail\&.ngo\&.org/32 \-\-said %pass\fR
.SH "FILES"
.PP
/proc/net/ipsec_eroute, /usr/local/bin/ipsec
.SH "SEE ALSO"
.PP
ipsec(8), ipsec_manual(8), ipsec_tncfg(8), ipsec_spi(8), ipsec_spigrp(8), ipsec_klipsdebug(8), ipsec_eroute(5)
.SH "HISTORY"
.PP
Written for the Linux FreeS/WAN project <\m[blue]\fBhttp://www\&.freeswan\&.org/\fR\m[]> by Richard Guy Briggs\&.
